package org.krakenapps.pcap.decoder.smb.rr;

import java.util.HashMap;
import java.util.Map;

public enum NtStatus {
	STATUS_SUCCESS(0x00000000),
	STATUS_INVALID_SMB(0x00010002),
	STATUS_SMB_BAD_TID(0x00050002),
	STATUS_SMB_BAD_COMMAND(0x00160002),
	STATUS_SMB_BAD_UID(0x005B0002),
	STATUS_SMB_USE_STANDARD(0x00FB0002),
	STATUS_BUFFER_OVERFLOW(0x80000005),
	STATUS_NO_MORE_FILES(0x80000006),
	STATUS_STOPPED_ON_SYMLINK(0x8000002D),
	STATUS_NOT_IMPLEMENTED(0xC0000002),
	STATUS_INVALID_PARAMETER(0xC000000D),
	STATUS_NO_SUCH_DEVICE(0xC000000E),
	STATUS_INVALID_DEVICE_REQUEST(0xC0000010),
	STATUS_MORE_PROCESSING_REQUIRED(0xC0000016),
	STATUS_ACCESS_DENIED(0xC0000022),
	STATUS_BUFFER_TOO_SMALL(0xC0000023),
	STATUS_OBJECT_NAME_NOT_FOUND(0xC0000034),
	STATUS_OBJECT_NAME_COLLISION(0xC0000035),
	STATUS_OBJECT_PATH_NOT_FOUND(0xC000003A),
	STATUS_BAD_IMPERSONATION_LEVEL(0xC00000A5),
	STATUS_IO_TIMEOUT(0xC00000B5),
	STATUS_FILE_IS_A_DIRECTORY(0xC00000BA),
	STATUS_NOT_SUPPORTED(0xC00000BB),
	STATUS_NETWORK_NAME_DELETED(0xC00000C9),
	STATUS_USER_SESSION_DELETED(0xC0000203),
	STATUS_NETWORK_SESSION_EXPIRED(0xC000035C),
	STATUS_SMB_TOO_MANY_UIDS(0xC000205A);
	private static Map<Integer, NtStatus> codeMap = new HashMap<Integer, NtStatus>();
	static {
		for (NtStatus code : NtStatus.values()) {
			codeMap.put(code.getCode(), code);
		}
	}
	public int getCode() {
		return status;
	}
	public static NtStatus parse(int code) {
		return codeMap.get(code);
	}
	
	NtStatus(int code){
		this.status = code;
	}
	private int status;

}
